// how to generate the nodes to connect to
F0 get_nodes = curry(curry(generate_nodes, syncdir), suffix);

// choice function: average
F1 chooser = new F1<List<Integer>, Integer>() {
	public Integer f(List<Integer> l){
		return average(l);
	}
}
	
// reducing function, executes remotely
F2 reducer = new F2<Integer, Integer, Integer>() {
    public Integer f(Integer a, Integer b) {
        List<Integer> l = some_really_complicated_function (a,b);
		List<Integer> l2 = distMap(get_nodes, mapper, l); // dmap'
		return distReduce(get_nodes, reducer2, l2);       // dreduce'
    }
};

// in main, or elsewhere...
List replications = list(1,1,2,1,3,4,2);
int result = distReduce(replications, chooser, get_nodes, reducer, my_list);


